<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //{}
        let object={
            "name":"zhangsan",
            "age":18
        }
        console.log(object)
        //new
        let ob=new Object()
        ob.name="zhang"
        console.log(ob.name)
        //构造函数
        function Person(name,age){
            this.name=name
            this.age=age
        }
        let p1=new Person()
        p1.name="lisi"
        p1.age=18
        console.log(p1.name)
        console.log(p1.age)
        let p2=new Person()
        p2.sayhi=function(a){
            console.log(a)
        }
        p2.sayhi("hello")
        p2.name="yuyu"
        console.log(p2.name)
    </script>
</body>
</html>